package org.example.inboundhandlerandoutboundhandler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

public class TestOutboundHandler extends ChannelOutboundHandlerAdapter {
    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        // 在这里处理要发送的数据
        System.out.println("Sending data: " + msg);
        // 将数据写入到下一个处理器或通道中
        ctx.writeAndFlush(msg, promise);
    }
}
